Event notification for ::SCardListReaders() [migrated]

Posted by dpb on Programmers See other posts from Programmers or by dpb
Published on 2014-08-25T14:11:09Z Indexed on 2014/08/25 16:27 UTC
Read the original article Hit count: 1460

Filed under:
|
|

In the PC/SC (Personal Computer Smart Card) Appln, I have (MSCAPI USB CCID based)

1) Calling ::SCardListReaders() returns SCARD_E_NO_READERS_AVAILABLE (0x8010002E). This call is made after OS starts fresh after reboot, from a thread which is part of my custom windows service.

2) Adding delay before ::SCardListReaders() call solves the problem.

3) How can I solve this problem elegantly ? Not using delay & waiting for some event to notify me.

since a) Different machines may require different delay values b) Cannot loop since the error code is genuine c) Could not find this event as part of System Event Notification Service or similar COM interface d) platform is Windows 7

Any Help Appreciated.

© Programmers or respective owner

Related posts about Hardware

Related posts about windows-7